﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PetaPoco;
namespace ZhongheCms.Models
{
    public partial class GswTblCustomer
    {
        [ResultColumn]
        public GswTblUser GswTblUser { get; set; }
         [ResultColumn]
        public List<GswTblModuleText>  GswTblModuleTexts { get; set; }
         [ResultColumn]
        public List<GswTblUserPower> UserPowers { get; set; }
        public static List<GswTblCustomer> GetCustomer(string tname)
        {
            var sql = "select * from GswTblCustomer where delFlag=0";
            if (!string.IsNullOrEmpty(tname))
                sql += " and (CusShortName like '%" + tname + "%' or CustomerName like '%" + tname + "%' or Contact like '%" + tname + "%')";
            sql += " order by id desc";
            var qry = Fetch(sql);
            return qry;
        }
    }
}